package com.hkts.naturalgas.flow.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.hkts.naturalgas.flow.VO.FlowNodeinfoVo;
import com.hkts.naturalgas.flow.entity.FlowNodeinfo;
import com.hkts.naturalgas.flow.entity.FlowTaskHandler;
import com.hkts.naturalgas.flow.entity.FlowTaskInstance;
import com.hkts.naturalgas.performance.performanceTo.HontUserTo;

/**
 * <p>
 * 服务类
 * </p>
 *
 * @author zy
 * @since 2022-09-07
 */
public interface IFlowTaskHandlerService extends IService<FlowTaskHandler> {
    FlowNodeinfoVo getFlowNodeinfoOnLevel(FlowNodeinfo flowNodeinfo, Integer level);

    /**
     * 跳过低等级角色
     * @param flowNodeinfo
     * @param level
     * @param hontDepartmentId
     * @param taskId
     * @return
     */
    FlowNodeinfoVo addFlowTaskHandlerOnLevel(FlowNodeinfo flowNodeinfo, Integer level, String hontDepartmentId,
                                             String taskId,Integer isOrganization);

    /**
     * 正常审批流程
     * @param flowNodeinfo
     * @param taskId
     * @return
     */
    FlowNodeinfo addFlowTaskHandler(FlowNodeinfo flowNodeinfo,  String hontDepartmentId,
                                    String taskId,Integer isOrganization);

    boolean checkUser(String taskId, String userId);

    /**
     * 验证当前节点是否跳过
     * @param u
     * @param flowNodeinfo
     * @param hontDepartmentId
     * @param isOrganization
     * @return
     */
    boolean skipNodeInfo(HontUserTo u, FlowNodeinfo flowNodeinfo, String hontDepartmentId, Integer isOrganization);

    void updateFlowTaskHandler(FlowTaskInstance flowTaskInstance, String hontDepartmentId,Integer isOrganization);

    void deleteByTaskId(String taskId);
}
